<?php

namespace app\admin\controller;

use think\Controller;
use app\admin\model\Logs as M;

class Logs extends Controller
{

    public function index()
    {
        return $this->fetch();
    }

    //获取日志josn数据
    public function getlogs_josn()
    {
        $m          = new M();
        $shopslist  = $m->getLogs(); //每页数据
        $shopscount = $m->getLogsCount(); //总条数
        $count      = count($shopscount);
        $lists      = ['code' => 0, 'msg' => '', 'count' => $count, 'data' => []];
        foreach ($shopslist as $k => $v)
        {
            $v['type']       = log_status($v['type']);
            $lists['data'][] = $v;
        }
        return $lists;
    }

}
